//
//  MLTServiceCategoryCardCollectionViewCell.m
//  MotherLover
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 zj. All rights reserved.
//

#import "MLTServiceCategoryCardCollectionViewCell.h"

@implementation MLTServiceCategoryCardCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        CGFloat height = frame.size.height;
        CGFloat width = frame.size.width;
        
        
        //上图片
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, height * 2 / 3 + 50)];
        self.imageView.backgroundColor = [UIColor orangeColor];
        self.imageView.layer.cornerRadius = 30;
        self.imageView.layer.masksToBounds = YES;
        [self.contentView addSubview:self.imageView];
        
        //下视图
        self.view = [[UILabel alloc] initWithFrame:CGRectMake(0, height * 2 / 3, width, height / 3)];
        self.view.backgroundColor = [UIColor whiteColor];
        self.view.layer.cornerRadius = 30;
        self.view.layer.masksToBounds = YES;
        [self.contentView addSubview:self.view];
        
        
        //类型
        self.typeLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, width, 20)];
        self.typeLable.textAlignment = NSTextAlignmentCenter;
        [self.view addSubview:_typeLable];
        
        //分割线
        self.lineView = [[UIView alloc] initWithFrame:CGRectMake(50, _typeLable.bottom + 3, width - 100, 2)];
        self.lineView.backgroundColor = [UIColor blackColor];
        [self.view addSubview:_lineView];
        
        
        //省份图片
        self.provinceImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_lineView.left + _lineView.frame.size.width / 12, _lineView.bottom + 15, _lineView.frame.size.width / 10, _lineView.frame.size.width / 10)];
        self.provinceImageView.image = [UIImage imageNamed:@"province"];
        [self.view addSubview:_provinceImageView];
        
        //省份
        self.provinceLable = [[UILabel alloc] initWithFrame:CGRectMake(_provinceImageView.right + 10, _provinceImageView.bottom - 20, 150, 20)];
        [self.view addSubview:_provinceLable];
        
        //城市图片
        self.cityImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_provinceImageView.left, _provinceImageView.bottom + 10, _provinceImageView.frame.size.width, _provinceImageView.frame.size.height)];
        self.cityImageView.image = [UIImage imageNamed:@"city"];
        [self.view addSubview:_cityImageView];
        
        //城市
        self.cityLable = [[UILabel alloc] initWithFrame:CGRectMake(_cityImageView.right + 10, _cityImageView.bottom - 20, 150, 20)];
        [self.view addSubview:_cityLable];
        
        
        //地区图片
        self.areaImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_cityImageView.left, _cityImageView.bottom + 10, _cityImageView.frame.size.width, _cityImageView.frame.size.height)];
        self.areaImageView.image = [UIImage imageNamed:@"area"];
        [self.view addSubview:_areaImageView];
        
        //地区
        self.areaLable = [[UILabel alloc] initWithFrame:CGRectMake(_areaImageView.right + 10, _areaImageView.bottom - 20, 150, 20)];
        [self.view addSubview:_areaLable];
        
        
        
        
    }
    
    return self;
}

#pragma mark -- 重写赋值
- (void)setNameString:(NSString *)nameString
{
    _nameString = nameString;
    _typeLable.text = nameString;
    
    
    
}

- (void)setPicString:(NSString *)picString
{
    _picString = picString;
    
    self.imageView.image = [UIImage imageNamed:picString];
}

- (void)setProvinceString:(NSString *)provinceString
{
    _provinceString = provinceString;
    _provinceLable.text = provinceString;
    
}

- (void)setCityString:(NSString *)cityString
{
    _cityString = cityString;
    _cityLable.text = cityString;
}

- (void)setAreaString:(NSString *)areaString
{
    _areaString = areaString;
    _areaLable.text = areaString;
}

@end
